<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/common/common.jsp" %>
<html>
<head>
    <meta charset="utf-8"/>
    <title>厅干部平时考核管理系统</title>
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/views/wdzb.js'/>"></script>
</head>

<body >
<input type="hidden" id="type" value="${type }"/>
<div class="njga" style="overflow: auto;">
    <div class="bmkhcp" style="padding: 1px;">
        <div class="bmkhcp_lf" style="width: 100%;overflow-x:hidden;overflow-y:hidden;">
            <div class="title">
                <c:if test="${type=='1'}">我的周报</c:if>
                <c:if test="${type=='2'}">我的月报</c:if>
            </div>
            <div class="khzpzp_row khzpzp_row1" style="height: 40px;margin-top:8px;">
                <div class="p_text" style="width: 80px;">开始时间</div>
                <div class="zp_select">
                    <input type="text" placeholder="请选择日期" id="dateinfo" name="months" class="inpt1"/>
                    <div class="arrow_down"></div>
                </div>
                <div class="p_text" style="width: 80px;">结束时间</div>
                <div class="zp_select">
                    <input type="text" placeholder="请选择日期" id="dateinfo1" name="months" class="inpt1"/>
                    <div class="arrow_down"></div>
                </div>
                <button class="btn btn1" onclick="search0bj()">查询</button>
              <%--  <c:if test="${result}">--%>
                    <div class="xzzb_add" onclick="addLog(-1)"><span>+</span>
                        <c:if test="${type=='1'}">新增周报</c:if>
                        <c:if test="${type=='2'}">新增月报</c:if>
                    </div>
               <%-- </c:if>--%>
            </div>
            <table id="boot_table">
            </table>

        </div>
    </div>

</div>

<script type="text/javascript">
    var index1 = 2;
    var index2 = 2;
    var index3 = 2;
    $(document).ready(function () {
        initTable();
        jeDate({
            dateCell: "#dateinfo1",
            format: "YYYY-MM-DD",
            choosefun: function (val) {
                //alert(111);
            }

        });
        jeDate({
            dateCell: "#dateinfo",
            format: "YYYY-MM-DD",
            choosefun: function (val) {
                //alert(111);
            }

        });
        $(".td_select_xl").slideUp(200);
        $(".text_rt").click(function (e) {
            e = e || window.event;
            if (e.stopPropagation) {
                e.stopPropagation();
            } else {
                e.cancelBubble = true;
            }
            $(this).children(".td_select_xl").slideToggle(200);
            $(this).parents(".row_pop_new").siblings(".row_pop_new").find(".td_select_xl").slideUp(200);
            var selecttext = $(this).children("p");
            var selectmain = $(this).children(".td_select_xl");
            var lis = selectmain.find('li');
            for (var i = 0; i < lis.length; i++) {
                lis[i].onclick = function () {
                    selectmain.hide();
                    var textval = $(this).html();
                    selecttext.text(decodeURIComponent(textval));
                }
            }
        });
        $(".td_select_xl li").click(function (e) {
            e = e || window.event;
            if (e.stopPropagation) {
                e.stopPropagation();
            } else {
                e.cancelBubble = true;
            }
            $(".td_select_xl").slideUp(200);
        });
        //自我评价
        $(".ldpj_table_td .inpt_w_l").click(function () {
            $(this).addClass("inpt_w_l_hov");
            $(this).parent(".inpt_w").siblings(".inpt_w").children(".inpt_w_l").removeClass("inpt_w_l_hov");
        });
        //考勤情况
        $(document).click(function () {
            $(".td_select_xl").slideUp(200);
        });
        $(".td_select1").click(function (e) {
            e = e || window.event;
            if (e.stopPropagation) {
                e.stopPropagation();
            } else {
                e.cancelBubble = true;
            }
            $(this).next(".td_select_xl").slideToggle(200);
            $(this).parents("tr").siblings("tr").find(".td_select_xl").hide();
            var selecttext = $(this).children("p");
            var selectmain = $(this).next(".td_select_xl");
            var lis = selectmain.find('li');
            for (var i = 0; i < lis.length; i++) {
                lis[i].onclick = function () {
                    selectmain.hide();
                    var textval = $(this).html();
                    selecttext.text(decodeURIComponent(textval));
                }
            }
        });
        //领导评鉴-选择分数结束

        $("#ckgzrz").on("click", function () {
            var open = layer.open({
                type: 1, //0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）。
                shift: 1, //动画    0-6     css3动画
                closeBtn: 1, //关闭按钮  0 不显示  style  1和2  标题为 false 2
                btn: '确定',
                title: ['工作日志', 'background:#5f9ad1;color:#fff;text-align: left;font-size: 18px;'],
                area: ['660px', 'auto'], //宽高
                content: $("#date_pop1") //iframe层-禁滚动条  $("#photosDemo").html()   'http://www.baidu.com/'
            });
        });
    });

    function addLog(dbid) {
        var title = "我的周报";
        if ("${type}" == "2") {
            title = "我的月报";
        } else if ("${type}" == "1") {
            title = "我的周报";
        }
        var url = "<c:url value='/worklog/editWdzb/@.html'/>".replace("@", dbid) + "?type=" + "${type}";
        var open = layer.open({
            type: 2,//0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）。
            shift: 1,//动画    0-6     css3动画
            closeBtn: 1,       //关闭按钮  0 不显示  style  1和2  标题为 false 2
            btn: ['保存', '取消'],
            btn1: function (index, layero) {
                var newpsw = $(layero).find("iframe")[0].contentWindow;
                newpsw.submitForm();
            },
            title: [title, 'background:#5f9ad1;color:#fff;text-align: left;font-size: 18px;'],
            area: ['800px', '500px'], //宽高
            content: url //iframe层-禁滚动条  $("#photosDemo").html()   'http://www.baidu.com/'
        });
    }
    <%--function submitForm() {--%>
    <%--//top.mask();--%>
    <%--$("#submit_form").ajaxSubmit({--%>
    <%--type: "post",--%>
    <%--dataType: "json",--%>
    <%--success: function (data) {--%>
    <%--if (data.data.status == 1) {--%>
    <%--showMessage('操作成功！');--%>
    <%--window.setTimeout(function () {--%>
    <%--var url ="";--%>
    <%--if(("${type }"=="2"&&("${ismj }"=="1"||"${iscjgb }"=="1"))||("${type }"=="3"&&"${iszhz }"=="1")){--%>
    <%--url="<c:url value='/jump/khcp_zp.html'/>";--%>
    <%--}else{--%>
    <%--url = "<c:url value='/worklog/wdzb/@.html'/>".replace("@","${type}");--%>
    <%--}--%>
    <%--$('#ifrm_data', parent.document).attr("src", url);--%>
    <%--}, 2000);--%>
    <%--} else {--%>
    <%--showMessage(data.data.body);--%>
    <%--}--%>
    <%--},--%>
    <%--error: function () {--%>


    <%--showMessage("失败！");--%>
    <%--}--%>
    <%--});--%>
    <%--}--%>
    function showMessage(content) {
        layer.open({
            title: '信息'
            , content: content
        });
    }


    function hideTable(type, obj) {
        if (type == 0) {
            $("#clickId").attr("href", "javascript:hideTable(1)");
            $("#clickId").attr("title", "点击显示")
            $("#hideTable").hide();
        }
        if (type == 1) {
            $("#clickId").attr("href", "javascript:hideTable(0)");
            $("#clickId").attr("title", "点击隐藏")
            $("#hideTable").show();
        }
    }

    function search0bj() {
        $('#boot_table').bootstrapTable('refresh', {url: "<c:url value='/worklog/wdzblist.json?start='/>" + $("#dateinfo").val() + "&end=" + $("#dateinfo1").val()});
    }
</script>
</body>

</html>